/* 
 * File:   c_array.h
 * Author: Marcelo Juchem <juchem at gmail dot com>
 *
 * Created on August 17, 2011, 3:27 AM
 */

#ifndef INCLUDED_cscience_array_c_array_h
#    define	INCLUDED_cscience_array_c_array_h

#include <cstddef>

namespace cscience {
namespace array {

template <typename TValue, size_t m_size>
class static_array
{
public:
	typedef TValue value_type;

private:
	value_type m_array[m_size];

public:
	size_type size() const
	{
		return m_size;
	}

	value_type const &operator [](size_type index) const
	{
		return this->m_array[index];
	}

	value_type &operator [](size_type index)
	{
		return this->m_array[index];
	}

	operator value_type const *() const
	{
		return this->m_array;
	}

	operator value_type *()
	{
		return this->m_array;
	}
};

} // namespace array {
} // namespace cscience {

#endif // INCLUDED_cscience_array_c_array_h
